package com.softeem.service.impl;

import com.softeem.entity.Admin;
import com.softeem.entity.AdminExample;
import com.softeem.mapper.AdminMapper;
import com.softeem.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author cj
 * @create 2021-04-2021/4/27 0027 19:02
 */
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    // 管理员登录
    @Override
    public boolean login(Admin admin) {
        AdminExample adminExample = new AdminExample();
        adminExample.createCriteria().andANameEqualTo(admin.getaName()).andAPasswordEqualTo(admin.getaPassword());
        return adminMapper.selectByExample(adminExample).size() > 1;
    }
}
